<!DOCTYPE html>

<html lang="en" data-content_root="../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <title>CMAKE_SYSTEM_NAME &mdash; CMake 4.1.1 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=a2c47e09" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css?v=4d06bd55" />
    
    <script src="../_static/documentation_options.js?v=e6a937a4"></script>
    <script src="../_static/doctools.js?v=9bcbadda"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    
    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="CMAKE_SYSTEM_PROCESSOR" href="CMAKE_SYSTEM_PROCESSOR.html" />
    <link rel="prev" title="CMAKE_SYSTEM" href="CMAKE_SYSTEM.html" />
 

  </head><body>
    <input id="sidebar-check" type="checkbox" />
    <label id="sidebar-overlay" for="sidebar-check"></label>



    <div class="related relbar1" role="navigation" aria-label="Related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="CMAKE_SYSTEM_PROCESSOR.html" title="CMAKE_SYSTEM_PROCESSOR"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="CMAKE_SYSTEM.html" title="CMAKE_SYSTEM"
             accesskey="P">previous</a> |</li>
  <li>
    <label class="sidebar-toggle" for="sidebar-check"></label>
  </li>
  <li class="rootlink">
    <img src="../_static/cmake-logo-16.png" width="16" height="16" alt=""/>
    <a href="https://cmake.org/">CMake 4.1.1</a>
    <span class="reldelim1"> &#187;</span>
  </li>
  <li>
    <a href="../index.html">Documentation</a> &#187;
  </li>

          <li class="nav-item nav-item-1"><a href="../manual/cmake-variables.7.html" accesskey="U">cmake-variables(7)</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">CMAKE_SYSTEM_NAME</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="cmake-system-name">
<span id="variable:CMAKE_SYSTEM_NAME"></span><h1>CMAKE_SYSTEM_NAME<a class="headerlink" href="#cmake-system-name" title="Link to this heading">¶</a></h1>
<p>The name of the operating system for which CMake is to build.
See the <span class="target" id="index-0-variable:CMAKE_SYSTEM_VERSION"></span><a class="reference internal" href="CMAKE_SYSTEM_VERSION.html#variable:CMAKE_SYSTEM_VERSION" title="CMAKE_SYSTEM_VERSION"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CMAKE_SYSTEM_VERSION</span></code></a> variable for the OS version.</p>
<p>Note that <code class="docutils literal notranslate"><span class="pre">CMAKE_SYSTEM_NAME</span></code> is not set to anything by default when running
in script mode, since it's not building anything.</p>
<section id="system-name-for-host-builds">
<h2>System Name for Host Builds<a class="headerlink" href="#system-name-for-host-builds" title="Link to this heading">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">CMAKE_SYSTEM_NAME</span></code> is by default set to the same value as the
<span class="target" id="index-0-variable:CMAKE_HOST_SYSTEM_NAME"></span><a class="reference internal" href="CMAKE_HOST_SYSTEM_NAME.html#variable:CMAKE_HOST_SYSTEM_NAME" title="CMAKE_HOST_SYSTEM_NAME"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CMAKE_HOST_SYSTEM_NAME</span></code></a> variable so that the build
targets the host system.</p>
</section>
<section id="system-name-for-cross-compiling">
<h2>System Name for Cross Compiling<a class="headerlink" href="#system-name-for-cross-compiling" title="Link to this heading">¶</a></h2>
<p><code class="docutils literal notranslate"><span class="pre">CMAKE_SYSTEM_NAME</span></code> may be set explicitly when first configuring a new build
tree in order to enable <a class="reference internal" href="../manual/cmake-toolchains.7.html#cross-compiling-toolchain"><span class="std std-ref">cross compiling</span></a>.
In this case the <span class="target" id="index-1-variable:CMAKE_SYSTEM_VERSION"></span><a class="reference internal" href="CMAKE_SYSTEM_VERSION.html#variable:CMAKE_SYSTEM_VERSION" title="CMAKE_SYSTEM_VERSION"><code class="xref cmake cmake-variable docutils literal notranslate"><span class="pre">CMAKE_SYSTEM_VERSION</span></code></a> variable must also be
set explicitly.</p>
</section>
<section id="system-names-known-to-cmake">
<h2>System Names Known to CMake<a class="headerlink" href="#system-names-known-to-cmake" title="Link to this heading">¶</a></h2>
<p>The following is a list of possible values, each associated with corresponding
operating systems or environments.</p>
<table class="docutils align-default">
<thead>
<tr class="row-odd"><th class="head"><p>Value</p></th>
<th class="head"><p>Name</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">ADSP</span></code></p></td>
<td><p>Analog Devices Audio Digital Signal Processing</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">AIX</span></code></p></td>
<td><p>IBM Unix operating system</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Android</span></code></p></td>
<td><p>Android operating system</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">ARTOS</span></code></p></td>
<td><p>Operating system for microcontrollers</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">BeOS</span></code></p></td>
<td><p>Operating system for personal computers (discontinued)</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">BlueGeneL</span></code></p></td>
<td><p>Blue Gene/L static environment</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">BlueGeneP-dynamic</span></code></p></td>
<td><p>Blue Gene/P dynamic environment</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">BlueGeneP-static</span></code></p></td>
<td><p>Blue Gene/P static environment</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">BlueGeneQ-dynamic</span></code></p></td>
<td><p>Blue Gene/Q dynamic environment</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">BlueGeneQ-static</span></code></p></td>
<td><p>Blue Gene/Q static environment</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">BSDOS</span></code></p></td>
<td><p>BSD operating system (discontinued)</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Catamount</span></code></p></td>
<td><p>Operating system for Cray XT series</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">CrayLinuxEnvironment</span></code></p></td>
<td><p>Cray Linux Environment</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">CYGWIN</span></code></p></td>
<td><p>Cygwin environment for Windows</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Darwin</span></code></p></td>
<td><p>Apple stationary operating systems (macOS, OS X, etc.)</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">DOS</span></code></p></td>
<td><p>MS-DOS or compatible</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">DragonFly</span></code></p></td>
<td><p>BSD-derived operating system</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">eCos</span></code></p></td>
<td><p>Real-time embedded operating system</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Emscripten</span></code></p></td>
<td><p>Compiler toolchain to WebAssembly</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Euros</span></code></p></td>
<td><p>Real-time operating system for embedded devices</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">FreeBSD</span></code></p></td>
<td><p>FreeBSD operating system</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Fuchsia</span></code></p></td>
<td><p>Operating system by Google based on the Zircon kernel</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Generic-ADSP</span></code></p></td>
<td><p>Generic ADSP (Audio DSP) environment</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Generic-ELF</span></code></p></td>
<td><p>Generic ELF (Executable and Linkable Format) environment</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Generic</span></code></p></td>
<td><p>Some platforms, e.g. bare metal embedded devices</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">GHS-MULTI</span></code></p></td>
<td><p>Green Hills Software MULTI environment</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">GNU</span></code></p></td>
<td><p>GNU/Hurd-based operating system</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Haiku</span></code></p></td>
<td><p>Unix operating system inspired by BeOS</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">HP-UX</span></code></p></td>
<td><p>Hewlett Packard Unix</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">iOS</span></code></p></td>
<td><p>Apple mobile phone operating system</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">Linux</span></code></p></td>
<td><p>All Linux-based distributions</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Midipix</span></code></p></td>
<td><p>POSIX-compatible layer for Windows</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">MirBSD</span></code></p></td>
<td><p>MirOS BSD operating system</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">MP-RAS</span></code></p></td>
<td><p>MP-RAS UNIX operating system</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">MSYS</span></code></p></td>
<td><p>MSYS environment (MSYSTEM=MSYS)</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">NetBSD</span></code></p></td>
<td><p>NetBSD operating systems</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">OpenBSD</span></code></p></td>
<td><p>OpenBSD operating systems</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">OpenVMS</span></code></p></td>
<td><p>OpenVMS operating system by HP</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">OS2</span></code></p></td>
<td><p>OS/2 operating system</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">OSF1</span></code></p></td>
<td><p>Compaq Tru64 UNIX (formerly DEC OSF/1, Digital Unix) (discontinued)</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">QNX</span></code></p></td>
<td><p>Unix-like operating system by BlackBerry</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">RISCos</span></code></p></td>
<td><p>RISC OS operating system</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">SCO_SV</span></code></p></td>
<td><p>SCO OpenServer 5</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">SerenityOS</span></code></p></td>
<td><p>Unix-like operating system</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">SINIX</span></code></p></td>
<td><p>SINIX operating system</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">SunOS</span></code></p></td>
<td><p>Oracle Solaris and all illumos operating systems</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">syllable</span></code></p></td>
<td><p>Syllable operating system</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Tru64</span></code></p></td>
<td><p>Compaq Tru64 UNIX (formerly DEC OSF/1) operating system</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">tvOS</span></code></p></td>
<td><p>Apple TV operating system</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">ULTRIX</span></code></p></td>
<td><p>Unix operating system (discontinued)</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">UNIX_SV</span></code></p></td>
<td><p>SCO UnixWare (pre release 7)</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">UnixWare</span></code></p></td>
<td><p>SCO UnixWare 7</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">visionOS</span></code></p></td>
<td><p>Apple mixed reality operating system</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">WASI</span></code></p></td>
<td><p>WebAssembly System Interface</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">watchOS</span></code></p></td>
<td><p>Apple watch operating system</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Windows</span></code></p></td>
<td><p>Windows stationary operating systems</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">WindowsCE</span></code></p></td>
<td><p>Windows Embedded Compact</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">WindowsPhone</span></code></p></td>
<td><p>Windows mobile phone operating system</p></td>
</tr>
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">WindowsStore</span></code></p></td>
<td><p>Universal Windows Platform applications</p></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">Xenix</span></code></p></td>
<td><p>SCO Xenix Unix operating system (discontinued)</p></td>
</tr>
</tbody>
</table>
<p>Platform-specific notes:</p>
<ul class="simple">
<li><p>MSYS2's <code class="docutils literal notranslate"><span class="pre">msys/cmake</span></code> package (<code class="docutils literal notranslate"><span class="pre">/usr/bin/cmake</span></code>) works only under
<code class="docutils literal notranslate"><span class="pre">MSYSTEM=MSYS</span></code> environments, with system name <code class="docutils literal notranslate"><span class="pre">MSYS</span></code>.  Under other
environments like <code class="docutils literal notranslate"><span class="pre">MSYSTEM=MINGW64</span></code>, use another package such
as <code class="docutils literal notranslate"><span class="pre">mingw64/mingw-w64-x86_64-cmake</span></code> (<code class="docutils literal notranslate"><span class="pre">/mingw64/bin/cmake</span></code>),
which targets <code class="docutils literal notranslate"><span class="pre">MSYSTEM=MINGW64</span></code> with system name <code class="docutils literal notranslate"><span class="pre">Windows</span></code>.</p></li>
<li><p>Cygwin's <code class="docutils literal notranslate"><span class="pre">cmake</span></code> package (<code class="docutils literal notranslate"><span class="pre">/usr/bin/cmake</span></code>) uses system name <code class="docutils literal notranslate"><span class="pre">CYGWIN</span></code>.
A non-cygwin CMake on Windows (e.g. <code class="docutils literal notranslate"><span class="pre">$PROGRAMFILES/CMake/bin/cmake</span></code>)
uses system name <code class="docutils literal notranslate"><span class="pre">Windows</span></code> even when it runs under a Cygwin environment.</p></li>
</ul>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
  <div>
    <h3>Table of Contents</h3>
    <ul>
<li><a class="reference internal" href="#">CMAKE_SYSTEM_NAME</a><ul>
<li><a class="reference internal" href="#system-name-for-host-builds">System Name for Host Builds</a></li>
<li><a class="reference internal" href="#system-name-for-cross-compiling">System Name for Cross Compiling</a></li>
<li><a class="reference internal" href="#system-names-known-to-cmake">System Names Known to CMake</a></li>
</ul>
</li>
</ul>

  </div>
  <div>
    <h4>Previous topic</h4>
    <p class="topless"><a href="CMAKE_SYSTEM.html"
                          title="previous chapter">CMAKE_SYSTEM</a></p>
  </div>
  <div>
    <h4>Next topic</h4>
    <p class="topless"><a href="CMAKE_SYSTEM_PROCESSOR.html"
                          title="next chapter">CMAKE_SYSTEM_PROCESSOR</a></p>
  </div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/variable/CMAKE_SYSTEM_NAME.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="Related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="CMAKE_SYSTEM_PROCESSOR.html" title="CMAKE_SYSTEM_PROCESSOR"
             >next</a> |</li>
        <li class="right" >
          <a href="CMAKE_SYSTEM.html" title="CMAKE_SYSTEM"
             >previous</a> |</li>
  <li>
    <label class="sidebar-toggle" for="sidebar-check"></label>
  </li>
  <li class="rootlink">
    <img src="../_static/cmake-logo-16.png" width="16" height="16" alt=""/>
    <a href="https://cmake.org/">CMake 4.1.1</a>
    <span class="reldelim1"> &#187;</span>
  </li>
  <li>
    <a href="../index.html">Documentation</a> &#187;
  </li>

          <li class="nav-item nav-item-1"><a href="../manual/cmake-variables.7.html" >cmake-variables(7)</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">CMAKE_SYSTEM_NAME</a></li> 
      </ul>
    </div>

    <div class="footer" role="contentinfo">
    &#169; Copyright 2000-2025 Kitware, Inc. and Contributors.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
    </div>
<script type="text/javascript">
(function() {
  "use strict";
  const hide = () => document.getElementById("sidebar-check").checked = false;
  addEventListener("keydown", e => (e.key === "Escape") && hide());
  addEventListener("click", e => (e.target.tagName === "A") && hide());
  addEventListener("hashchange", hide)
})();
</script>
  </body>
</html>